#ifndef APP_MAIN_H
#define APP_MAIN_H

#ifdef _WIN32
# include <wtypes.h>
#endif

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib/gstdio.h>
#include <curl/curl.h>

//#include <event2/event.h>

#include "../doc/protocol_api.h"
#include "../common/sockio.h"
#include "../common/util_list_ctrl.h"
#include "../common/util_packet.h"
#include "server.h"
#include "packet.h"

#define SERVER_NAME         "SimpServer"
#define SERVER_VER          0x00000002
#define	LOG_ACCESS_PATH	    "access.log"
#define	LOG_DEBUG_PATH	    "debug.log"

#ifdef __cplusplus
extern "C" {
#endif

extern FILE                 *log_access,
                            *log_debug;

gchar * s_convert(const gchar *str, gssize len, const gchar *to, const gchar *from, gchar *dst);
void    avatar_resize( void * av );
void    avatar_convert( void * av );
size_t  avatar_write_cb(guchar *data, size_t size, size_t nmemb, void * av);
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif	// APP_MAIN_H
